#Replication code for Study 2 (AMOS) in 'How does Partisanship Influence Policy Diffusion?'
#Authors: Daniel Butler and Miguel Pereira.
#Note: if you have any questions, please contact Miguel Pereira (m.pereira@wustl.edu).
library(lmtest)

setwd('INSERT PATH HERE')
amos<-read.csv('amos_data.csv')

amos$tr_copartisan[amos$partisan!=1]<-NA
amos$republican<-ifelse(amos$party==1,1,0)
amos$extreme<-abs(amos$libcon-4)
amos$progamb<-abs(4-amos$progamb_runhigher)
amos$tenure<-ifelse(is.na(amos$tenure),4,amos$tenure)


################################################### 
## TABLE 3 - Copartisan effects (AMOS)
###################################################

#ALL (column 1)
t.test(amos$dv_policy[amos$partisan==1&amos$tr_copartisan==1],
       amos$dv_policy[amos$partisan==1&amos$tr_copartisan==0])
length(na.omit(amos$dv_policy[amos$partisan==1]))
(se.amos.all<-sqrt(sd(na.omit(amos$dv_policy[amos$partisan==1&amos$tr_copartisan==1]))^2 / 
                    length(na.omit(amos$dv_policy[amos$partisan==1&amos$tr_copartisan==1])) + 
                    sd(na.omit(amos$dv_policy[amos$partisan==1&amos$tr_copartisan==0]))^2 / 
                    length(amos$dv_policy[amos$partisan==1&amos$tr_copartisan==0])))


#BOTH (column 2)
t.test(amos$dv_policy[amos$partisan==1&(amos$tr_diff_both==1)&amos$tr_copartisan==1],
       amos$dv_policy[amos$partisan==1&(amos$tr_diff_both==1)&amos$tr_copartisan==0])
length(na.omit(amos$dv_policy[amos$partisan==1&(amos$tr_diff_both==1)]))
(se.amos.both<-sqrt(sd(na.omit(amos$dv_policy[amos$partisan==1&(amos$tr_diff_both==1)&amos$tr_copartisan==1]))^2 / 
                     length(na.omit(amos$dv_policy[amos$partisan==1&(amos$tr_diff_both==1)&amos$tr_copartisan==1])) + 
                     sd(na.omit(amos$dv_policy[amos$partisan==1&(amos$tr_diff_both==1)&amos$tr_copartisan==0]))^2 / 
                     length(amos$dv_policy[amos$partisan==1&(amos$tr_diff_both==1)&amos$tr_copartisan==0])))

#CHOICE (column 3)
t.test(amos$dv_policy[amos$partisan==1&(amos$tr_diff_choice==1)&amos$tr_copartisan==1],
       amos$dv_policy[amos$partisan==1&(amos$tr_diff_choice==1)&amos$tr_copartisan==0])
length(na.omit(amos$dv_policy[amos$partisan==1&(amos$tr_diff_choice==1)]))
(se.amos.choice<-sqrt(sd(na.omit(amos$dv_policy[amos$partisan==1&(amos$tr_diff_choice==1)&amos$tr_copartisan==1]))^2 / 
                       length(na.omit(amos$dv_policy[amos$partisan==1&(amos$tr_diff_choice==1)&amos$tr_copartisan==1])) + 
                       sd(na.omit(amos$dv_policy[amos$partisan==1&(amos$tr_diff_choice==1)&amos$tr_copartisan==0]))^2 / 
                       length(amos$dv_policy[amos$partisan==1&(amos$tr_diff_choice==1)&amos$tr_copartisan==0])))

#CONTROL (column 4)
t.test(amos$dv_policy[amos$partisan==1&(amos$tr_diff_choice==0)&(amos$tr_diff_both==0)&amos$tr_copartisan==1],
       amos$dv_policy[amos$partisan==1&(amos$tr_diff_choice==0)&(amos$tr_diff_both==0)&amos$tr_copartisan==0])
length(na.omit(amos$dv_policy[amos$partisan==1&(amos$tr_diff_choice==0)&(amos$tr_diff_both==0)]))
(se.amos.ct<-sqrt(sd(na.omit(amos$dv_policy[amos$partisan==1&(amos$tr_diff_choice==0)&(amos$tr_diff_both==0)&amos$tr_copartisan==1]))^2 / 
                   length(na.omit(amos$dv_policy[amos$partisan==1&(amos$tr_diff_choice==0)&(amos$tr_diff_both==0)&amos$tr_copartisan==1])) + 
                   sd(na.omit(amos$dv_policy[amos$partisan==1&(amos$tr_diff_choice==0)&(amos$tr_diff_both==0)&amos$tr_copartisan==0]))^2 / 
                   length(amos$dv_policy[amos$partisan==1&(amos$tr_diff_choice==0)&(amos$tr_diff_both==0)&amos$tr_copartisan==0])))


################################################### 
## TABLE 4 - Independents (AMOS columns) 
###################################################
amos$ind<-ifelse(amos$party==3,1,0)
#ALL
t.test(amos$dv_policy[amos$ind==1&amos$tr_diff_repub==0],amos$dv_policy[amos$ind==1&amos$tr_diff_repub==1])
length(na.omit(amos$dv_policy[amos$ind==1])) #N
(se.ind.all<-sqrt(sd(na.omit(amos$dv_policy[amos$ind==1&amos$tr_diff_repub==0]))^2 / 
                   length(na.omit(amos$dv_policy[amos$ind==1&amos$tr_diff_repub==0])) + 
                   sd(na.omit(amos$dv_policy[amos$ind==1&amos$tr_diff_repub==1]))^2 / 
                   length(amos$dv_policy[amos$ind==1&amos$tr_diff_repub==1])))

#BOTH
t.test(amos$dv_policy[amos$ind==1&amos$tr_diff_repub==0&(amos$tr_diff_both==1)],
       amos$dv_policy[amos$ind==1&amos$tr_diff_repub==1&(amos$tr_diff_both==1)])
length(na.omit(amos$dv_policy[amos$ind==1&(amos$tr_diff_both==1)])) #N
(se.ind.both<-sqrt(sd(na.omit(amos$dv_policy[amos$ind==1&amos$tr_diff_repub==0&(amos$tr_diff_both==1)]))^2 / 
                    length(na.omit(amos$dv_policy[amos$ind==1&amos$tr_diff_repub==0&(amos$tr_diff_both==1)])) + 
                    sd(na.omit(amos$dv_policy[amos$ind==1&amos$tr_diff_repub==1&(amos$tr_diff_both==1)]))^2 / 
                    length(amos$dv_policy[amos$ind==1&amos$tr_diff_repub==1&(amos$tr_diff_both==1)])))

#CHOICE
t.test(amos$dv_policy[amos$ind==1&amos$tr_diff_repub==0&(amos$tr_diff_choice==1)],
       amos$dv_policy[amos$ind==1&amos$tr_diff_repub==1&(amos$tr_diff_choice==1)])
length(na.omit(amos$dv_policy[amos$ind==1&(amos$tr_diff_choice==1)])) #N
(se.ind.choice<-sqrt(sd(na.omit(amos$dv_policy[amos$ind==1&amos$tr_diff_repub==0&(amos$tr_diff_choice==1)]))^2 / 
                      length(na.omit(amos$dv_policy[amos$ind==1&amos$tr_diff_repub==0&(amos$tr_diff_choice==1)])) + 
                      sd(na.omit(amos$dv_policy[amos$ind==1&amos$tr_diff_repub==1&(amos$tr_diff_choice==1)]))^2 / 
                      length(amos$dv_policy[amos$ind==1&amos$tr_diff_repub==1&(amos$tr_diff_choice==1)])))

#NONE
t.test(amos$dv_policy[amos$ind==1&amos$tr_diff_repub==0&(amos$tr_diff_choice==0)&(amos$tr_diff_both==0)],
       amos$dv_policy[amos$ind==1&amos$tr_diff_repub==1&(amos$tr_diff_choice==0)&(amos$tr_diff_both==0)])
length(na.omit(amos$dv_policy[amos$ind==1&(amos$tr_diff_choice==0)&(amos$tr_diff_both==0)])) #N
(se.ind.ct<-sqrt(sd(na.omit(amos$dv_policy[amos$ind==1&amos$tr_diff_repub==0&(amos$tr_diff_choice==0)&(amos$tr_diff_both==0)]))^2 / 
                  length(na.omit(amos$dv_policy[amos$ind==1&amos$tr_diff_repub==0&(amos$tr_diff_choice==0)&(amos$tr_diff_both==0)])) + 
                  sd(na.omit(amos$dv_policy[amos$ind==1&amos$tr_diff_repub==1&(amos$tr_diff_choice==0)&(amos$tr_diff_both==0)]))^2 / 
                  length(na.omit(amos$dv_policy[amos$ind==1&amos$tr_diff_repub==1&(amos$tr_diff_choice==0)&(amos$tr_diff_both==0)]))))


################################################### 
## TABLE 5 - What do officials choose to see? 
###################################################
#Note: variable allchoices takes the following values
## 1 - see none; 2 - see pros only; 3 - see cons only; 4 - see both
amos$allchoices<-ifelse(amos$choose1==3, 1, ifelse(amos$choose1==1&amos$pros_next==2, 2, 
                                                   ifelse(amos$choose1==2&amos$cons_next==2,3,4)))

#CHOSE TO SEE NONE (column 1)
amos$allchoices1<-ifelse(is.na(amos$allchoices),NA,ifelse(amos$allchoices==1,1,0))

t.test(amos$allchoices1[amos$tr_copartisan==1],
       amos$allchoices1[amos$tr_copartisan==0])
(sd.choices1<-sqrt(sd(na.omit(amos$allchoices1[amos$tr_copartisan==1]))^2/length(na.omit(amos$allchoices1[amos$tr_copartisan==1])) +
                    sd(na.omit(amos$allchoices1[amos$tr_copartisan==0]))^2/length(na.omit(amos$allchoices1[amos$tr_copartisan==0]))  ))
table(na.omit(amos$tr_diff_choice[amos$partisan==1]))[2] #N

#CHOSE TO SEE BOTH (column 2)
amos$allchoices4<-ifelse(is.na(amos$allchoices),NA,ifelse(amos$allchoices==4,1,0))
t.test(amos$allchoices4[amos$tr_copartisan==1],
       amos$allchoices4[amos$tr_copartisan==0])
(sd.choices4<-sqrt(sd(na.omit(amos$allchoices4[amos$tr_copartisan==1]))^2/length(na.omit(amos$allchoices4[amos$tr_copartisan==1])) +
                    sd(na.omit(amos$allchoices4[amos$tr_copartisan==0]))^2/length(na.omit(amos$allchoices4[amos$tr_copartisan==0]))  ))
table(na.omit(amos$tr_diff_choice[amos$partisan==1])) #N


#PROS FIRST (column 3)
amos$profirst<-ifelse(is.na(amos$choose1),NA,ifelse(amos$choose1==1,1,0))
t.test(amos$profirst[amos$choose1<3&amos$tr_copartisan==1],
       amos$profirst[amos$choose1<3&amos$tr_copartisan==0])
(sd.profirst<-sqrt(sd(na.omit(amos$profirst[amos$choose1<3&amos$tr_copartisan==1]))^2/length(na.omit(amos$profirst[amos$choose1<3&amos$tr_copartisan==1])) +
                    sd(na.omit(amos$profirst[amos$choose1<3&amos$tr_copartisan==0]))^2/length(na.omit(amos$profirst[amos$choose1<3&amos$tr_copartisan==0]))  ))
length(na.omit(amos$choose1[amos$choose1<3&amos$tr_copartisan%in%c(1,0)])) #N


################################################### 
## TABLE 6 - Policy interest by information processed 
###################################################
#Choose1: 1 - pros first; 2 - cons first; 3 - none

#No information
t.test(amos$dv_policy[amos$choose1==3&amos$tr_copartisan==1],
       amos$dv_policy[amos$choose1==3&amos$tr_copartisan==0])
length(na.omit(amos$dv_policy[amos$choose1==3&(is.na(amos$tr_copartisan)!=T)]))
(se.amos.none<-sqrt(sd(na.omit(amos$dv_policy[amos$choose1==3&amos$tr_copartisan==1]))^2 / 
                     length(na.omit(amos$dv_policy[amos$choose1==3&amos$tr_copartisan==1])) + 
                     sd(na.omit(amos$dv_policy[amos$choose1==3&amos$tr_copartisan==0]))^2 / 
                     length(amos$dv_policy[amos$choose1==3&amos$tr_copartisan==0])))

#Any information
#All choice: 1 - see none; 2 - see pros only; 3 - see cons only; 4 - see both
t.test(amos$dv_policy[amos$allchoices!=1&amos$tr_copartisan==1],
       amos$dv_policy[amos$allchoices!=1&amos$tr_copartisan==0])
length(na.omit(amos$dv_policy[amos$allchoices!=1&amos$tr_copartisan%in%c(0,1)]))
(se.amos.any<-sqrt(sd(na.omit(amos$dv_policy[amos$allchoices!=1&amos$tr_copartisan==1]))^2 / 
                    length(na.omit(amos$dv_policy[amos$allchoices!=1&amos$tr_copartisan==1])) + 
                    sd(na.omit(amos$dv_policy[amos$allchoices!=1&amos$tr_copartisan==0]))^2 / 
                    length(amos$dv_policy[amos$allchoices!=1&amos$tr_copartisan==0])))



################################################### 
## TABLE A3 - Descriptives (AMOS)
###################################################
# Years in office
mean(na.omit(amos$tenure))
# % Elected
1-prop.table(table(amos$partisanelect))[1]
# % Term limits
prop.table(table(na.omit(amos$termlimits)))[1]
# Party distribution  
prop.table(table(amos$party))
# %Non-partisan elections
amos$nonpart<-ifelse(amos$partisanelect==2,1,ifelse(amos$partisanelect==3,0,NA))
prop.table(table(amos$nonpart))


################################################### 
## TABLE A4 - Covariate Balance
###################################################
amos$choice_treats<-ifelse(amos$tr_diff_both==1&amos$tr_copartisan==1,1,
                           ifelse(amos$tr_diff_both==1&amos$tr_copartisan==0,2,
                                  ifelse(amos$tr_diff_choice==1&amos$tr_copartisan==1,3,
                                         ifelse(amos$tr_diff_choice==1&amos$tr_copartisan==0,4,
                                                ifelse(amos$tr_diff_none==1&amos$tr_copartisan==1,5,
                                                       ifelse(amos$tr_diff_none==1&amos$tr_copartisan==0,6,NA))))))

#Mean Republican
mean(na.omit(amos$republican[amos$tr_diff_both==1&amos$tr_copartisan==1]))
mean(na.omit(amos$republican[amos$tr_diff_both==1&amos$tr_copartisan==0]))

mean(na.omit(amos$republican[amos$tr_diff_choice==1&amos$tr_copartisan==1]))
mean(na.omit(amos$republican[amos$tr_diff_choice==1&amos$tr_copartisan==0]))

mean(na.omit(amos$republican[amos$tr_diff_none==1&amos$tr_copartisan==1]))
mean(na.omit(amos$republican[amos$tr_diff_none==1&amos$tr_copartisan==0]))

summary(aov(republican~choice_treats,amos))

#Mean Conservatism
mean(na.omit(amos$libcon[amos$tr_diff_both==1&amos$tr_copartisan==1]))
mean(na.omit(amos$libcon[amos$tr_diff_both==1&amos$tr_copartisan==0]))

mean(na.omit(amos$libcon[amos$tr_diff_choice==1&amos$tr_copartisan==1]))
mean(na.omit(amos$libcon[amos$tr_diff_choice==1&amos$tr_copartisan==0]))

mean(na.omit(amos$libcon[amos$tr_diff_none==1&amos$tr_copartisan==1]))
mean(na.omit(amos$libcon[amos$tr_diff_none==1&amos$tr_copartisan==0]))

summary(aov(libcon~choice_treats,amos))

#Mean Extremism
mean(na.omit(amos$extreme[amos$tr_diff_both==1&amos$tr_copartisan==1]))
mean(na.omit(amos$extreme[amos$tr_diff_both==1&amos$tr_copartisan==0]))

mean(na.omit(amos$extreme[amos$tr_diff_choice==1&amos$tr_copartisan==1]))
mean(na.omit(amos$extreme[amos$tr_diff_choice==1&amos$tr_copartisan==0]))

mean(na.omit(amos$extreme[amos$tr_diff_none==1&amos$tr_copartisan==1]))
mean(na.omit(amos$extreme[amos$tr_diff_none==1&amos$tr_copartisan==0]))

summary(aov(extreme~choice_treats,amos))

#Mean Tenure
mean(na.omit(amos$tenure[amos$tr_diff_both==1&amos$tr_copartisan==1]))
mean(na.omit(amos$tenure[amos$tr_diff_both==1&amos$tr_copartisan==0]))

mean(na.omit(amos$tenure[amos$tr_diff_choice==1&amos$tr_copartisan==1]))
mean(na.omit(amos$tenure[amos$tr_diff_choice==1&amos$tr_copartisan==0]))

mean(na.omit(amos$tenure[amos$tr_diff_none==1&amos$tr_copartisan==1]))
mean(na.omit(amos$tenure[amos$tr_diff_none==1&amos$tr_copartisan==0]))

summary(aov(tenure~choice_treats,amos))

#Mean Progressive Ambition
mean(na.omit(amos$progamb[amos$tr_diff_both==1&amos$tr_copartisan==1]))
mean(na.omit(amos$progamb[amos$tr_diff_both==1&amos$tr_copartisan==0]))

mean(na.omit(amos$progamb[amos$tr_diff_choice==1&amos$tr_copartisan==1]))
mean(na.omit(amos$progamb[amos$tr_diff_choice==1&amos$tr_copartisan==0]))

mean(na.omit(amos$progamb[amos$tr_diff_none==1&amos$tr_copartisan==1]))
mean(na.omit(amos$progamb[amos$tr_diff_none==1&amos$tr_copartisan==0]))

summary(aov(progamb~choice_treats,amos))


#RANDOMIZATION CHECK
# # Likelihood ratio tests for logit models with treatment assignments as the outcomes. 
amos$libcon<-ifelse(is.na(amos$libcon), mean(na.omit(amos$libcon)), amos$libcon)
amos$extreme<-ifelse(is.na(amos$extreme), mean(na.omit(amos$extreme)), amos$extreme)
amos$progamb<-ifelse(is.na(amos$progamb), mean(na.omit(amos$progamb)), amos$progamb)

#Copartisan v. Non-Copartisan
m1<-glm(tr_copartisan~republican+libcon+extreme+tenure+progamb,family="binomial",amos[amos$partisan==1,])
m1n<-glm(tr_copartisan~1,family="binomial",amos[amos$partisan==1,])
lrtest(m1n,m1)

#Both v. Choice
amos$both_v_choice<-ifelse(amos$tr_diff_both==1,1,
                           ifelse(amos$tr_diff_choice==1,0,NA))
m5<-glm(both_v_choice~republican+libcon+extreme+tenure+progamb,family="binomial",amos[amos$partisan==1,])
m5n<-glm(both_v_choice~1,family="binomial",amos[amos$partisan==1,])
lrtest(m5n,m5)

#Both v. Control
amos$both_v_control<-ifelse(amos$tr_diff_both==1,1,
                            ifelse(amos$tr_diff_none==1,0,NA))
m6<-glm(both_v_control~republican+libcon+extreme+tenure+progamb,family="binomial",amos[amos$partisan==1,])
m6n<-glm(both_v_control~1,family="binomial",amos[amos$partisan==1,])
lrtest(m6n,m6)

#Choice v. Control
amos$choice_v_control<-ifelse(amos$tr_diff_choice==1,1,
                              ifelse(amos$tr_diff_none==1,0,NA))
m7<-glm(choice_v_control~republican+libcon+extreme+tenure+progamb,family="binomial",amos[amos$partisan==1,])
m7n<-glm(choice_v_control~1,family="binomial",amos[amos$partisan==1,])
lrtest(m7n,m7)

###############
## TABLE A5 - Determinants of willingness to see info
###############
amos$seearguments<-ifelse(amos$choose1==3,0,1)
amos$seearguments[amos$tr_diff_choice==1]<-ifelse(is.na(amos$seearguments[amos$tr_diff_choice==1]),0,amos$seearguments[amos$tr_diff_choice==1])
amos$republican<-ifelse(amos$party==1,1,0)
amos$democrat<-ifelse(amos$party==2,1,0)
amos$tr_copartisan<-ifelse(amos$party==1 & amos$tr_diff_repub==1,1, 
                           ifelse(amos$party==2 & amos$tr_diff_repub==0,1,0))

#Column 1
summary(glm(seearguments~tr_copartisan+republican+democrat+libcon+extreme+tenure+progamb,family="binomial",amos))
#Column 2
summary(glm(seearguments~tr_copartisan+republican+libcon+extreme+tenure+progamb,family="binomial",amos[amos$partisan==1,]))



###############
## TABLE A7 - Distribution of responses
###############
#ALL (cols 1-2)
(ps<-round(prop.table(table(amos$tr_copartisan,amos$dv_policy),1),2))
ct<-table(amos$tr_copartisan,amos$dv_policy)
chisq.test(ct)


#BOTH (cols 3-4)
(ps_both<-round(prop.table(table(amos$tr_copartisan[amos$partisan==1&amos$tr_diff_both==1],
                                amos$dv_policy[amos$partisan==1&amos$tr_diff_both==1]),1),2))
ct_both<-table(amos$tr_copartisan[amos$partisan==1&amos$tr_diff_both==1],
               amos$dv_policy[amos$partisan==1&amos$tr_diff_both==1])
chisq.test(ct_both)

#CHOICE (cols 5-6)
(ps_choice<-round(prop.table(table(amos$tr_copartisan[amos$partisan==1&amos$tr_diff_choice==1],
                                  amos$dv_policy[amos$partisan==1&amos$tr_diff_choice==1]),1),2))
ct_choice<-table(amos$tr_copartisan[amos$partisan==1&amos$tr_diff_choice==1],
                 amos$dv_policy[amos$partisan==1&amos$tr_diff_choice==1])
chisq.test(ct_choice)

#NONE (cols 7-8)
(ps_none<-round(prop.table(table(amos$tr_copartisan[amos$partisan==1&amos$tr_diff_choice==0&amos$tr_diff_both==0],
                                amos$dv_policy[amos$partisan==1&amos$tr_diff_choice==0&amos$tr_diff_both==0]),1),2))
ct_none<-table(amos$tr_copartisan[amos$partisan==1&amos$tr_diff_choice==0&amos$tr_diff_both==0],
               amos$dv_policy[amos$partisan==1&amos$tr_diff_choice==0&amos$tr_diff_both==0])
chisq.test(ct_none)



###############
## TABLE C1 - Time spent on pros/cons by treatment condition
###############

# # # BOTH CONDITION
# Time spent on PROS for copartisans
summary(amos$ti_diff_pros_3[amos$tr_copartisan==1 & amos$ti_diff_pros_3<60])[4]
summary(amos$ti_diff_pros_3[amos$tr_copartisan==0 & amos$ti_diff_pros_3<60])[4]
# Time spent on CONS for copartisans & non-copartisans
summary(amos$ti_diff_cons_3[amos$tr_copartisan==1 & amos$ti_diff_cons_3<60])[4]
summary(amos$ti_diff_cons_3[amos$tr_copartisan==0 & amos$ti_diff_cons_3<60])[4]

# # # CHOICE CONDITION
amos$choice_pros<-ifelse(is.na(amos$ti_diff_choose2_3),amos$ti_diff_choose5_3, amos$ti_diff_choose2_3)
amos$choice_cons<-ifelse(is.na(amos$ti_diff_choose3_3),amos$ti_diff_choose4_3, amos$ti_diff_choose3_3)
amos$choice_total<-amos$choice_pros+amos$choice_cons

# Time spent on PROS for copartisans
summary(amos$choice_pros[amos$tr_copartisan==1 & amos$choice_pros<60])[4]
summary(amos$choice_pros[amos$tr_copartisan==0 & amos$choice_pros<60])[4]
# Time spent on CONS for copartisans & non-copartisans
summary(amos$choice_cons[amos$tr_copartisan==1 & amos$choice_cons<60])[4]
summary(amos$choice_cons[amos$tr_copartisan==0 & amos$choice_cons<60])[4]

# # # TWO INFORMATION CONDITIONS COMBINED
amos$time_cons<-ifelse(is.na(amos$ti_diff_cons_3)!=T,amos$ti_diff_cons_3,amos$choice_cons)
amos$time_pros<-ifelse(is.na(amos$ti_diff_pros_3)!=T,amos$ti_diff_pros_3,amos$choice_pros)
amos$time_cons_pros<-amos$time_cons+amos$time_pros

# Time spent on PROS for copartisan & non-copartisans
# Non-Cop = Cop
summary(amos$time_pros[amos$tr_copartisan==1 & amos$time_pros<60])[4]
summary(amos$time_pros[amos$tr_copartisan==0 & amos$time_pros<60])[4]
# Time spent on CONS and pros for copartisans
summary(amos$time_cons[amos$tr_copartisan==1 & amos$time_cons<60])[4]
summary(amos$time_cons[amos$tr_copartisan==0 & amos$time_cons<60])[4]
# Full time, by partisan condition
summary(amos$time_cons_pros[amos$tr_copartisan==1 & amos$time_cons_pros<120])[4]
summary(amos$time_cons_pros[amos$tr_copartisan==0 & amos$time_cons_pros<120])[4]


